export const SlamStateType: Record<number, string> = {
  0: '无地图',
  1: '建图中',
  2: '定位丢失',
  3: '定位正常',
}

export const HeartbeatType: Record<number, string> = {
  0: 'Slam',
  1: 'MoveBase',
  2: 'MapMgr',
  3: 'MissionMgr',
  4: 'Hardware',
  5: 'Clamp',
  6: 'CommBridge',
}

export const WorkModes = {
  IDLE: 0,
  NAVIGATION: 1,
  CHARGING: 2,
}

export const FREE_NAV_MODE = 0
export const PATH_NAV_MODE = 1

export const TaskStates = {
  IDLE: 0,
  SUCCEED_STATUS: 1,
  FAIL_STATUS: 2,

  NORMAL_NAV: 0,
  PRECISION_NAV: 1,
  TO_ELEVATOR: 6,
  WAITING_ELEVATOR: 7,
  ENTER_ELEVATOR: 8,
  IN_ELEVATOR: 9,
  EXIT_ELEVATOR: 10,
  TO_TURNSTILE: 11,
  WAIT_TURNSTILE: 12,
  THROUGH_TURNSTILE: 13,
  TO_AUTOMATIC_DOOR: 16,
  WAIT_DOOR: 17,
  THROUGH_AUTOMATIC_DOOR: 18,
  SUCCEED_TO_GOTO: 21,
  FAILED_TO_GOTO: 22,

  TO_CHARGING: 0,
  DOCKING_CHARGER: 1,
  CHARGING: 2,
  UNDOCKING_CHARGER: 3,
  FAILED_TO_CHARGE: 6,
}

export const TaskStateTypes = {
  [WorkModes.IDLE]: '待命',
  [WorkModes.NAVIGATION]: '导航',
  [WorkModes.CHARGING]: '充电',
}

export const TaskStateStatuses = {
  [WorkModes.IDLE]: {
    [TaskStates.IDLE]: '空闲',
    [TaskStates.SUCCEED_STATUS]: '成功',
    [TaskStates.FAIL_STATUS]: '失败',
  },
  [WorkModes.NAVIGATION]: {
    [TaskStates.NORMAL_NAV]: '普通导航',
    [TaskStates.PRECISION_NAV]: '精准导航',
    [TaskStates.TO_ELEVATOR]: '去电梯区',
    [TaskStates.WAITING_ELEVATOR]: '等待电梯中',
    [TaskStates.ENTER_ELEVATOR]: '进电梯',
    [TaskStates.IN_ELEVATOR]: '乘梯中',
    [TaskStates.EXIT_ELEVATOR]: '出电梯',
    [TaskStates.TO_TURNSTILE]: '去闸机区',
    [TaskStates.WAIT_TURNSTILE]: '等待闸机',
    [TaskStates.THROUGH_TURNSTILE]: '过闸机',
    [TaskStates.TO_AUTOMATIC_DOOR]: '去自动门区',
    [TaskStates.WAIT_DOOR]: '等待自动门',
    [TaskStates.THROUGH_AUTOMATIC_DOOR]: '过自动门',
    [TaskStates.SUCCEED_TO_GOTO]: '成功',
    [TaskStates.FAILED_TO_GOTO]: '失败',
  },
  [WorkModes.CHARGING]: {
    [TaskStates.TO_CHARGING]: '去充电',
    [TaskStates.DOCKING_CHARGER]: '对接充电桩',
    [TaskStates.CHARGING]: '充电中',
    [TaskStates.UNDOCKING_CHARGER]: '断开充电桩',
    [TaskStates.FAILED_TO_CHARGE]: '充电失败',
  },
}

export enum FUNC_TYPE {
  SET_MAP = 0,
  CLEAR_ALLWALL = 1,
  ADD_WALL = 2,
  SAVE_WALL = 3,
  CLEAR_ALLPOI = 4,
  ADD_POI = 5,
  SAVE_POI = 6,
  CLEAR_ALLPATH = 7,
  ADD_TEACH_PATH = 8,
  SAVE_TEACH_PATH = 9,
  ADD_TOPO_PATH = 10,
  SAVE_TOPO_PATH = 11,
  DELETE_MAP = 12,
  MAP_RENAME = 13,
  CLEAR_ALLZONE = 14,
  ADD_ZONE = 15,
  SAVE_ZONE = 16,
  ERASE_MAP = 17,
  DELETE_LOCAL_MAP = 18,
  CLEAR_LOCAL_MAP = 19,
}

export enum NAV_FUNC_TYPE {
  START = 0,
  CANCLE = 1,
}

export enum NAV_MODE {
  FREE = 0,
  PATH = 1,
}

export enum MISSION_FUNC_TYPE {
  START = 0,
  CANCLE = 1,
}

export enum MISSION_TYPE {
  NORMAL_POI = 0,
  MULTI_POI = 1,
  HOME_MISSION = 2,
  LOCATION = 4,
}

export enum MOTION_TYPE {
  FREE_GOTO = 0,
  TRACK_GOTO = 1,
  FOLLOW_GOTO = 2,
  EDGE_GOTO = 3,
  ZONE_COVER = 4,
  STANDBY = 5,
}

export const poi_type = -1
export const NormalPoIType = 0
export const PrecisePoIType = 1
export const AutoDoorWaitingPoIType = 6
export const AutoDoorEntrancePoIType = 7

export const LiftWaitingPoIType = 11
export const LiftEntrancePoIType = 12

export const GateWaitingPoIType = 16
export const GateEntrancePoIType = 17

export const PickUpPoIType = 21
export const PutDownPoIType = 22

export const ChargePoiType = 31
export const AuxCalibPoIType = 41
export const JackingUpPoIType = 42
export const PalletPoIType = 43

export enum ZONE_TYPE {
  DECEL_ZONE = 0,
  STOP_ZONE = 1,
  SLOPE_ZONE = 2,
}

export enum ZONE_SHAPE {
  RECTANGLE_SHAPE = 0,
  POLYGON_SHAPE = 1,
}

export enum SLAM_MODE {
  CREATE_MAP = 0,
  UPDATE_MAP = 1,
  CREATE_LOCAL_MAP = 2,
  LOCATION = 3,
  MODE_NONE = 4,
}
